package com.itheima.test01;

public class Person {
    private String name;
    private int pesonage;


    //keepPet( ????? ,String something)方法
    public void keepPet(Animal animal ,String something){
        //年龄为30岁的老王养了一只黑颜色的2岁的宠物
        System.out.println("年龄为"+pesonage+"岁的"+name+"养了一只"+animal.getColor()+"的"+animal.getAge()+"岁的宠物");
        if (animal instanceof Dog){
            animal.eat("骨头");
        }else {
            animal.eat("鱼");
        }
    }




    public Person() {
    }

    public Person(String name, int pesonage) {
        this.name = name;
        this.pesonage = pesonage;

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPesonage() {
        return pesonage;
    }

    public void setPesonage(int pesonage) {
        this.pesonage = pesonage;
    }
}
